package com.dgshanger.sanhxiaofeisc.mvp.model;

import com.blankj.utilcode.util.EncryptUtils;
import com.dgshanger.sanhxiaofeisc.common.AppApi;
import com.dgshanger.sanhxiaofeisc.entity.CheckPwdEntity;
import com.dgshanger.sanhxiaofeisc.mvp.contract.WithdrawContract;
import com.xx.baseutilslibrary.network.rx.RxHelper;
import com.xx.baseutilslibrary.network.rx.RxHttpObserver;

/**
 * WithdrawModel
 * 沉迷学习不能自拔
 * Describe：
 * Created by 雷小星🍀 on 2018/5/8 16:32.
 */

public class WithdrawModel implements WithdrawContract.Model {
    @Override
    public void withdraw(String account, String withdraw_money, String user_pay_pwd, RxHttpObserver<Object> httpObserver) {
        AppApi.Api()
                .withdraw_apply(account, withdraw_money, EncryptUtils.encryptMD5ToString(user_pay_pwd).toLowerCase())
                .compose(RxHelper.io_main())
                .subscribe(httpObserver);
    }

    @Override
    public void checkPayPwd(RxHttpObserver<CheckPwdEntity> httpObserver) {
        AppApi.Api().checkPwd()
                .compose(RxHelper.io_main())
                .subscribe(httpObserver);
    }
}
